import Vue from 'vue'
import Router from 'vue-router'

// components
const Layout = () => import('@/components/common/Layout') // 头部导航部分

// pages
const Index = () => import('@/pages/index.vue') // 首页
const AboutUs = () => import('@/pages/aboutus.vue') // 关于我们
const ViewGsjj = () => import('@/components/aboutus/ViewGsjj') //子路由-公司简介
const ViewXhzc = () => import('@/components/aboutus/ViewXhzc') //子路由-协会章程
const ViewZzjg = () => import('@/components/aboutus/ViewZzjg') //子路由-组织结构
const ViewXhfw = () => import('@/components/aboutus/ViewXhfw') //子路由-协会服务
const Industryinfo = () => import('@/pages/industryinfo.vue') //行业资讯
const ViewZxzx = () => import('@/components/industryinfo/ViewZxzx') //子路由-最新资讯
const ViewZxfg = () => import('@/components/industryinfo/ViewZxfg') //子路由-最新法规
const ViewDetails = () => import('@/components/industryinfo/ViewDetails') //子路由-资讯详情
const Dynamic = () => import('@/pages/dynamic.vue') //行业动态
const Member = () => import('@/pages/member.vue') //会员专区
const HyfcInfo = () => import('@/components/member/HyfcInfo') //会员详情
const XhldInfo = () => import('@/components/member/XhldInfo') //领导详情
const ViewHyfc = () => import('@/components/member/ViewHyfc')  //会员风采
const ViewHyhd = () => import('@/components/member/ViewHyhd') //会员活动
const ViewXhld = () => import('@/components/member/ViewXhld') //协会领导
const Branch = () => import('@/pages/branch') //分支机构
const Health = () => import('@/pages/health') //健康养生
const Contactus = () => import('@/pages/contactus') //联系我们

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Layout',
      component: Layout,
      children:[
        {
          path: '/',
          name: 'index',
          component: Index,
        },
        {
          path: '/aboutus',
          name: 'aboutus',
          component: AboutUs,
          children:[
            {
              path: '/',
              name: 'gsjj',
              component: ViewGsjj,
            },
            {
              path: 'xhzc',
              name: 'xhzc',
              component: ViewXhzc,
            },
            {
              path: 'zzjg',
              name: 'zzjg',
              component: ViewZzjg,
            },
          ]
        },
        {
          path: '/xhfw',
          name: 'xhfw',
          component: ViewXhfw,
        },
        {
          path: '/industryinfo',
          name: 'industryinfo',
          component: Industryinfo,
          children:[
            {
              path: '/',
              name: 'zxzx',
              component: ViewZxzx,
            },
            {
              path: 'zxfg',
              name: 'zxfg',
              component: ViewZxfg,
            },
          ]
        },
        {
          path: '/info/:id',
          name: 'info',
          component: ViewDetails,
        },
        {
          path: '/dynamic',
          name: 'dynamic',
          component: Dynamic
        },
        {
          path: '/member',
          name: 'member',
          component: Member,
          children:[
            {
              path: '/',
              name: 'xhld',
              component: ViewXhld
            },
            {
              path: 'hyfc',
              name: 'hyfc',
              component: ViewHyfc
            },
            {
              path: 'hyhd',
              name: 'hyhd',
              component: ViewHyhd
            },
          ]
        },
        {
          path: '/hyfcInfo/:id',
          name: 'hyfcInfo',
          component: HyfcInfo
        },
        {
          path: '/xhldInfo/:id',
          name: 'xhldInfo',
          component: XhldInfo
        },
        {
          path: '/branch',
          name: 'branch',
          component: Branch
        },
        {
          path: '/health',
          name: 'health',
          component: Health
        },
        {
          path: '/contactus',
          name: 'contactus',
          component: Contactus
        },
      ]
    }
  ]
})
